<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:ev="http://www.w3.org/2001/xml-events">
  <head>
    <title>Incremental Model Loading</title>
    <style type="text/css">body {font-family: Helvetica, Arial, sans-serif;</style>
    <xf:model>
      <!-- unconditionally loaded when the form loads -->
      <xf:instance id="people" src="people.xml">
          <null/>
      </xf:instance>
      
       <xf:instance id="places">
        <null/>
      </xf:instance>
      <xf:submission id="get-places" method="get" action="places.xml"
        replace="instance" instance="places"/>
      
       <xf:instance id="things">
        <null/>
      </xf:instance>
      <xf:submission id="get-things" method="get" action="things.xml"
        instance="things" replace="instance"/>
        
    </xf:model>
  </head>

  <body>        
    <h1>Incremental Model Loading</h1>
    <p>Not all parts of the model need to be loaded into a form when it is first loaded.  For
    large models, different sections can be loaded as they are needed.</p>

    <h2>People</h2>
      <xf:group ref="instance('people')">
         <xf:repeat nodeset="person">
           <xf:output ref="name"/><br/>
        </xf:repeat>
      </xf:group>
      
      <h2>Places</h2>
      <xf:group ref="instance('places')">
         <xf:repeat nodeset="place">
            <xf:output ref="name"/><br/>
        </xf:repeat>
        <xf:submit submission="get-places">
            <xf:label>Load Places</xf:label>
          </xf:submit>
      </xf:group>
      
      <h2>Things</h2>
      <xf:group ref="instance('things')">
         <xf:repeat nodeset="item">
            <xf:output ref="name"/><br/>
         </xf:repeat>
         <xf:submit submission="get-things">
            <xf:label>Load Things</xf:label>
          </xf:submit>
     </xf:group>

  </body>
</html> 
